/*
 * Copyright (c) 2019 Wormpex.com. All Rights Reserved.
 */

package com.sk.volat;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author ke.su date: 2019-11-13 Time: 上午12:02
 */
public class VolatileTest {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newScheduledThreadPool(400);

        A a = new A();

        // new Thread(() -> {
        //     while (true) {
        //         executorService.execute(() -> {
        //
        //             if (a.num != null) {
        //                 a.num.toString();
        //                 a.num = null;
        //             }
        //
        //
        //         });
        //     }
        // }).start();
        //
        // new Thread(() -> {
        //     while (true) {
        //         executorService.execute(() -> {
        //
        //             if (a.num == null) {
        //                 a.num = new B("a", "b", "c", "d", "e", "f", "g", "h");
        //             }
        //
        //         });
        //     }
        // }).start();


    }
}
